var typeList = null;
var navList;
var iconList;
var DEFAULT_IMG = 'images/default_m.png';
$(function(){ 
	navList = new NavList({				//初始化左边导航
		id:'navBox',
		moveRight:function(){			//向右事件
			iconList.setFocus();
		},
		onclick:function(data,id){
			$('#nav').html(data.name);
			 iconList.setDataList(data.dataList);
		}
	});
	
	
	iconList = new IconList({			//初始化右边导航
		id:'listBox',
		disNum:3,
		disRowNum:3,
		itemHeight:118,
		itemWidth:273,
		splitHeight:354,
		moveLeft:function(){
			navList.setFocus();
		},
		formatHtml:function(i,row,data){
			var img = $.getImageUrl(data.image,DEFAULT_IMG); 
			var cls = (i-1)%5 + 1;
			var con = '<div class="icon">';
				con += '<div class="bg'+cls+'">';
					con += '<div class="bgLeft">&nbsp;</div>';
					con += '<div class="bgRight"><div class="top">Now On Air</div><div class="title">'+data.name+'</div></div>';
				con +='</div>';
				con += '<a href="#" id="'+this.target+'-a-'+i+'" tar="'+i+'" row="'+row+'">&nbsp;</a>';
			con += '</div>';
			return con;
		},
		onfocus:function(data,id){
			
			
		},
		onclick:function(data,id){
			$.log($.toJSON(data));
		}
	}); 
	
	typeList = initData();
	navList.setDataList(typeList,true);
	navList.Click(1);
});


